<template>
  <div style="position: relative; height: 100%">
    <i-frame :src="reportUrl" style="height: 100%"></i-frame>
    <!-- 返回到首页 -->
    <div @click="goHome" class="back-home">
      <i class="el-icon-back"></i>
      返回
    </div>
  </div>
</template>
<script>
import { getToken } from "@/utils/auth";
import iFrame from "@/components/iFrame/index";
export default {
  name: "PyJeecgReport",
  components: { iFrame },
  data() {
    return {
      reportUrl:
        process.env.VUE_APP_BASE_API +
        "/jmreport/list?token=Bearer " +
        getToken(),
    };
  },
  mounted() {
    this.$store.dispatch("app/toggleSideBarHide", true);
    document.querySelector(".navbar").style.display = "none";
    document.querySelector(".tags-view-container").style.display = "none";
    document.querySelector(".app-main").style.height = "100%";
    document.querySelector(".app-wrapper").style.height = "100%";
  },
  beforeDestroy() {
    this.$store.dispatch("app/toggleSideBarHide", false);
    document.querySelector(".navbar").style.display = "flex";
    document.querySelector(".tags-view-container").style.display = "block";
    document.querySelector(".app-main").style.height = "calc(100% - 84px)";
    document.querySelector(".app-wrapper").style.height = "calc(100% - 84px)";
  },
  methods: {
    goHome() {
      this.$router.push({ path: "/" });
    },
  },
};
</script>

<style lang="scss" scoped>
.back-home {
  position: absolute;
  right: 0px;
  top: 3px;
  padding: 10px;
  color: #fff;
  cursor: pointer;
}
</style>
 